import DFA.xBuf;

import java.util.concurrent.ForkJoinPool;

public class Main {

    public static void main(String[] args) {
        xBuf xBuf = new xBuf(1,2);
        xBuf xBuf1 = new xBuf(1,2);
        xBuf xBuf2 = new xBuf(1,2);
        xBuf xBufD = new xBuf(3,2);




        int[]  array = {1,2,3,4,5};
        ForkJoinPool forkJoinPool= new ForkJoinPool();
        SumTask sumTask  = new SumTask(0,array.length-1,array);

        long start = System.currentTimeMillis();

        forkJoinPool.invoke(sumTask);
        System.out.println("The count is "+sumTask.join()
                +" spend time:"+(System.currentTimeMillis()-start)+"ms");
    }
}
